//
//  BooleanDelegate.m
//  cTypica
//
//  Created by David Kavanagh on 2/14/09.
//  Copyright 2009 directThought. All rights reserved.
//

#import "BooleanDelegate.h"


@implementation BooleanDelegate
@synthesize success;

+ (id)delegate {
	BooleanDelegate *ret = [self alloc];
	return ret;
}

// XML parser delegate methods
- (void)parser: (NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict {
}

- (void)parser: (NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
	NSString *cleanString = [currentStringValue stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
	[currentStringValue setString:@""];
	if ([elementName isEqualToString:@"return"]) {
		[self setSuccess:[cleanString isEqualToString:@"true"]];
	}
}
@end
